const moment = require('moment');

let dt = moment().format("YYYY-MM-DD HH:mm:ss");

console.log(dt);    // 2022-04-20 22:55:09